import request from "@/utlis/request";
//  request   导入就相当于导入了axios
//获取首页
export const getIndex = data => {
  return request.get("/api3/customindex", data);
};




//获取推荐课程params
export const getshowCorse = params=> {
  return request.get("wechat/index/courseLists",{params} );
};
//获取课程列表
export const getCorseList = data => {
  return request.post("/api2/QuestionBankCategory/topCategoryList", data);
};
//获取推荐课下  视屏课
export const getVideoPages = data => {
  return request.get(`api2/course/detail?cid=${data.cid}&uid=${data.uid}`);
};
//视屏课下目录页面
export const getVideoList = data => {
  return request.get(`api2/course/chapter?cid=${data.cid}&uid=${data.uid}`);
};
//题库下 二级分类
export const tikuCateList = data => {
  return request.get(`api2/QuestionBankCategory/topCategoryList?topId=${data}`
  );
};
//题库下 二级分类下数据
export const tikuData = data => {
  return request.post(`api2/QuestionBank/SubjectIndex`,
    data

  );
};



//搜索结果   
export const getSearchResultApi = params => {
  return request.get(`api2/search/index`, {
    params
  }
  );
};

/**
 * 
 * @description：我的页面
 * */
export const userInfo = (params) => {
  return request.get('api2/user/center/index', { params }
  );
};
//我的页面  购买课程  
export const courseBuy = (params) => {
  return request.get('api2/order/index', { params }
  );
};
export const courseCate = (params) => {
  return request.get('api2/order/packagelist', { params }
  );
};
export const courseLive = (params) => {
  return request.get('api2/live/alreadybought', { params }
  );
};
//vip页面
export const buyVip = (params) => {
  return request.get('api2/user/info', { params }
  );
};
// 我的题库
export const myhomeWork = (params) => {
  return request.get('api2/QuestionBank/userBankList', { params }
  );
};
// 消息中心  api2/user/message/ 
export const messageCenter = (params) => {
  return request.get('api2/user/message/', { params }
  );
};
//我的回答  api2/user/answer
export const myAnswer = (params) => {
  return request.get('api2/user/answer', { params }
  );
};
//我的  提问 api2/user/ask
export const myAsk = (params) => {
  return request.get('api2/user/answer', { params }
  );
};
//我的设置
export const mySetting = (params) => {
  return request.get('api2/user/center/index', { params }
  );
};
//我的学习 api2/studyList/recordList
export const myStudy = (params) => {
  return request.get('api2/studyList/recordList', { params }
  );
};
/**
 * @description：做题
 * */

//做题  章节练习 
export const testOne = (data) => {
  return request.post('api2/Question/index', data
  );
};
//收藏
export const courseCollect = (data) => {
  return request.post('api2/QuestionCollect/collect', data
  );
};
//答题完毕  获取总分数  
// ?uid=1364&subjectId=3
export const courseScore = (data) => {
  return request.post('api2/Question/scoreStatistics', data
  );
};
//提交一道题
export const postOneAnswer = (data) => {
  return request.post('api2/Question/questionSubmit', data
  );
};
//笔记提交
export const postNotes = (data) => {
  return request.post('api2/QuestionNote/takeNotes', data
  );
};

/**
 * @description:登录
*/
//手机号登录  发送验证码
export const sendCode = (mobile) => {
  return request.get('api2/user/SendSms?mobile=' + mobile
  );
};
//手机号 验证码登录  
export const loginApi = (data) => {
  return request.post('api2/user/PhoneLogin', data
  );
};